Xbasic

A5.LOAD_USER_COLORS Function

Syntax

A5.Load_User_Colors(c name,p color_info)

Arguments

name

The name of the color scheme. Currently, Alpha Anywhere only supports one color scheme named "Default".

color_info

The dot variable that receives the values of the custom colors. Color has the following sub-elements:

Sub-element
Description and Valid Values
.color[i].NAME

Name of the color "i", "I" can be between 1 and 32

.color[i].color.red

Red component, A value 0-255. 0 is black, 255 is red.

.color[i].color.green

green component, A value 0-255. 0 is black, 255 is green.

.color[i].color.blue

blue component, A value 0-255. 0 is black, 255 is blue.

.color[i].handle

internal color handle, Alpha Anywhere automatically assigns a value between 32 and 64. If color is new, assign a value of 0. Alpha Anywhere will automatically allocate a unique color handle for the entry.

Description

Loads custom color definitions into variables.

Discussion

The A5.LOAD_USER_COLORS() method populates a the Color dot variable with the values of the custom colors defined for the current database. Custom colors are defined using the View > Settings command.

The following script gets the custom color settings and stores them in a dot variable called Colors. The script then goes on to change the definition of color[1].

'Initialize Colors variable
dim colors.color[32] as P
for i = 1 to 32
    colors.color[i].NAME = ""
    colors.color[i].handle = 0
    colors.color[i].color.red = 0
    colors.color[i].color.green = 0
    colors.color[i].color.blue = 0
next
A5.load_user_colors("Default",colors)
'Change color 1 defition.
colors.color[1].name = "new red"
colors.color[1].color.red = 200
colors.color[1].color.green = 20
colors.color[1].color.blue = 20
'Save edited colors
A5.save_user_colors("Default",colors)

See Also